<?
$info = $GLOBALS['info'];
if (get_magic_quotes_gpc()){
        $GLOBALS['return_to'] = stripslashes_r($GLOBALS['return_to']);
}
$return_to_page = preg_replace('/:amp:/', '&', $GLOBALS['return_to']);
$return_to = preg_replace("/'/", "\'", $GLOBALS['return_to']);
$client_details = clientDetails($info['client_id']);
$client_domains = getClientDomains($info['client_id']);
//print_r($client_domains);

?>
<table class='account_table' style="border-bottom:0px;" bgcolor="#fcfcee" cellspacing=0 cellpadding=0 width=100%>
  <tr>
	<th colspan="3" align="left"><font color="#000000">&nbsp;&nbsp;&raquo; ACCOUNT DETAILS</font></th>
  </tr>
  <tr>
	<td valign="top" style="padding-left:10px;">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="90">Username:</td>
        <td><strong class="red"><? echo $client_details['username']; ?></strong>&nbsp;<a href="<?=loginClient($client_details['username']);?>" target='_blank'><img src="images/btn_mini_login_01.gif" alt="Login" border="0" align="absmiddle"></a></td>
      </tr>
      <tr>
        <td>Account Status:</td>
        <td><?=($client_details['blocked'] == 1 ? '<strong class="red">Blocked</strong>' : '<strong style="color:#006600;">Active</strong>');?></td>
      </tr>
      <tr>
        <td>Creation Date:</td>
        <td><strong><? echo date('m/d/Y', strtotime($client_details['start_date'])); ?></strong></td>
      </tr>
      <tr>
        <td>Expiration Date:</td>
        <td><strong><? echo date('m/d/Y', strtotime($client_details['expire_date'])); ?></strong>&nbsp;<? /*<a href="#"><img align="absmiddle" src="images/btn_mini_renew_01.gif" alt="Renew" border="0"></a>*/ ?></td>
      </tr>
      <tr>
        <td>Server:</td>
        <td><a href="http://<? echo $client_details['server']; ?>" target="_blank"><strong><? echo $client_details['server']; ?></strong></a></td>
      </tr>
    </table>
	</td>
	<td width="20">&nbsp;</td>
	<td valign="top" style="padding-right:10px;">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="90">Company:</td>
        <td><strong><? echo $client_details['company_name']; ?></strong></td>
      </tr>
      <tr>
        <td>Contact Name:</td>
        <td><strong><? echo $client_details['firstname'].' '.$client_details['lastname']; ?></strong></td>
      </tr>
      <tr>
        <td valign="top">Address:</td>
		<td>
			<strong>
			<?
			echo $client_details['address1'].'<br>'.
			($client_details['address2'] ? $client_details['address2'].'<br>' : '').
			ucwords($client_details['city']).' '.
			strtoupper($client_details['state']).' '.
			strtoupper($client_details['zip']).'<br>'.
			$client_details['country_name'];
			?>
			</strong>
		</td>
      </tr>
      <tr>
        <td>Tel:</td>
        <td><strong><? echo $client_details['phone']; ?></strong></td>
      </tr>
      <tr>
        <td>E-mail:</td>
        <td><strong><? echo $client_details['email']; ?></strong></td>
      </tr>
    </table></td>
  </tr>
  <tr>
	<td>&nbsp;</td>
	<td></td>
	<td></td>
  </tr>
</table>
<table cellspacing=0 cellpadding=0 width=100% class="myTable">
  <tr>
    <td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
    <td class='notselected' align="center" onClick="openPage('account(billing).html', 'info[client_id]=<?=$info[client_id]?>&info[order_id]=<?=$info[order_id]?>&return_to=' + encodeURI('<?=$return_to?>')); return false;"><b>Billing</b></td>
    <td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
    <td class='selected' align="center"><b>Domains</b></td>
    <td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
<?/*
    <td class='notselected' align="center"><strong>Notifications</strong></td>
	<td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
    <td class='notselected' align="center"><b>Events</b></td>
    <td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
    <td class='notselected' align="center"><strong>Plan Details</strong></td>
    <td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
    <td class='notselected' align="center"><strong>Log</strong></td>
    <td width='10' class='blank' bgcolor="#fcfcee">&nbsp;</td>
*/?>
  </tr>
  <tr>
    <td colspan=13 class='main'>
    <br />
    <br />
<?
if($client_domains['result']){
	echo "<table class='bTable' cellspacing=0 cellpadding=0 width=100%>
		<tr>
			<th>Domain</th>
			<th>DNS</th>
			<th>Expire Date</th>
			<th>Price</th>
		</tr>";
	foreach($client_domains['result'] as $k => $v){
		$v[product_retail] = unserialize(base64_decode($v[product_retail]));
		$v[product_wholesale] = unserialize(base64_decode($v[product_wholesale]));
		$retail = $GLOBALS['currencies']['USD'].' '.$v[product_retail][12][USD];
		$wholesale = $GLOBALS['currencies']['USD'].' '.$v[product_wholesale][12][USD];
		echo "<tr>
				<td align='center'><a href='http://$v[domain]' target='_blank'>$v[domain]</td>
				<td align='center'>$v[domain_ns1]<br>$v[domain_ns2]</td>
				<td align='center'>".date('m/d/Y', mktime($v['expire_date']))."</td>
				<td align='center'>
					<table width='80%' style='border:none;' border='0' cellspacing='0' cellpadding='0'>
					  <tr>
						<td align='right' style='border:none;'>$retail<br>
						<span style='font-size:10px' class='grey'>$wholesale</span></td>
						<td align='center' style='border:none;'><!--<a href='#'><img src='images/btn_mini_renew_01.gif' alt='Renew' border='0'></a>--></td>
					  </tr>
					</table>
				</td>
			</tr>";
	}
	echo '</table>';
}else{
	include($GLOBALS['path'].'no_results.html');
}
?>
		</td>
	</tr>
	<tr>
		<td align='center' colspan=13>
			<input type='button' value='Go Back' onClick="<?=$return_to_page?>">
		</td>
	</tr>
</table>
